<?php

    include('adodb/adodb.inc.php');
    include_once('adodb/adodb-pager.inc.php');
    include_once('conf/dbconn_param.php');
	
    $db = ADONewConnection($dbdriver);
    $db->Connect($server, $user, $password, $database);
    $db->SetFetchMode(ADODB_FETCH_ASSOC);

    $db->debug = false;

	$login = $_REQUEST["login"];
	$password = $_REQUEST["password"];

	$sql = "SELECT usu_id, usu_nombre, usu_permiso,usu_email  FROM usuario 
	WHERE usu_login = '$login' 
	and usu_password = PASSWORD('$password')";

	$rs1 = $db->Execute($sql);
	$datos = $rs1->GetRows();
	
	if ( $datos[0]["usu_id"] > 0){
?>
	<meta http-equiv=refresh content=0;URL=mian.php?userName=<? echo $datos[0]["usu_nombre"]?>&userId=<? echo $datos[0]["usu_id"]  ?>">

<?
	}
	else{
		echo "<center>¡ Password incorrecto o no válido !<br><br></center>";
		echo "<center><a href=login.php> Regresar a Login</a> <br></center>";
	}




?>